package com.km.app.service;

import com.km.app.dao.SysCompanyMapper;
import com.km.app.domain.po.SysCompany;
import com.km.app.util.IdGen;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: eric
 * Date: 2017-11-23
 * Time: 19:52
 */
@Service
@Transactional
public class CompanyService {
    private static final Logger LOGGER = LoggerFactory.getLogger(CompanyService.class);
    @Autowired
    private SysCompanyMapper sysCompanyMapper;

    public String saveApp(String name) {
        SysCompany vo = new SysCompany();
        vo.setId(IdGen.uuid());
        vo.setName(name);
        vo.setCreateDate(new Date());
        vo.setDelFlag("0");
        sysCompanyMapper.insertSelective(vo);
        return vo.getId();
    }
}
